CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0)
PROJECT(QShaderEdit)

SET(QShaderEdit_CMAKE_DIR "${QShaderEdit_SOURCE_DIR}/cmake")
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${QSE_CMAKE_DIR}")

SET(LIBS)

# Qt
SET(QT_MIN_VERSION 4.2.0)
FIND_PACKAGE(Qt4 REQUIRED)
#INCLUDE(FindQt4)
SET(QT_USE_QTOPENGL true)
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src)
#SET(LIBS ${LIBS} ${QT_QTCORE_LIBRARY_DEBUG} ${QT_QTGUI_LIBRARY_DEBUG} ${QT_QTOPENGL_LIBRARY_DEBUG})
SET(LIBS ${LIBS} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY})

# OpenGL
FIND_PACKAGE(OpenGL REQUIRED)
#INCLUDE(FindOpenGL)
IF(OPENGL_FOUND)
	MESSAGE(STATUS "Looking for OpenGL - found")
	INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_PATH})
	SET(LIBS ${LIBS} ${OPENGL_LIBRARIES})
ELSE(OPENGL_FOUND)
	MESSAGE(SEND_ERROR "Looking for OpenGL - not found")
ENDIF(OPENGL_FOUND)

# GLEW
#FIND_PACKAGE(GLEW REQUIRED)	
INCLUDE(${QShaderEdit_CMAKE_DIR}/FindGLEW.cmake)
IF(FOUND_GLEW)
	MESSAGE(STATUS "Looking for GLEW - found")
	INCLUDE_DIRECTORIES(${GLEW_INCLUDE_PATH})
	SET(LIBS ${LIBS} ${GLEW_LIBRARY})
ELSE(FOUND_GLEW)
	MESSAGE(SEND_ERROR "Looking for GLEW - not found")
ENDIF(FOUND_GLEW)

# Cg
#INCLUDE(${QShaderEdit_CMAKE_DIR}/FindCg.cmake)
#IF(FOUND_CG)
#	MESSAGE(STATUS "Looking for Cg - found")
#	INCLUDE_DIRECTORIES(${CG_INCLUDE_PATH})
#	SET(LIBS ${LIBS} ${CG_LIBRARY} ${CG_GL_LIBRARY})
#ELSE(FOUND_CG)
#	MESSAGE(STATUS "Looking for Cg - not found")
#ENDIF(FOUND_CG)

SUBDIRS(src)
